﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Mongaba
{
    public delegate void InsertedUserNameHandle(string name);

    public partial class frmInsertName : Form
    {
        public event InsertedUserNameHandle OnInsertedUserName;
        public frmInsertName()
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Mongaba;
            txtName.Focus();
        }

        private void btnConfirm_Click(object sender, EventArgs e)
        {
            if (! String.IsNullOrEmpty(txtName.Text))
            {
                OnInsertedUserName(txtName.Text);
            } 
            
            this.Close();
        }

       

        private void frmInsertName_Shown(object sender, EventArgs e)
        {
            txtName.Focus();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
